class Person {
  name: string
  age: number
  constructor(name: string, age: number) {
    this.name = name
    this.age = age
  }
  eat() {
    console.log('吃吃吃')
  }
}

class Student extends Person {
  grade: number
  constructor(name: string, age: number, grade: number) {
    super(name, age)
    this.grade = grade
  }

  study() {
    console.log('学习')
  }

  // override代表复写，表示子类重写父类的方法
  override eat() {
    console.log('吃')
  
  }
}

const s1 = new Student('张三', 18, 1)
s1.study()
s1.eat()

export {}